package com.jintoufs.weixin.activiti;

import com.jintoufs.service.message.MessageService;
import com.jintoufs.weixin.SupportAction;
import org.cosmos.modules.web.msg.AjaxMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by administrator on 2017/12/25.
 */
@Controller
@Scope("prototype")
@RequestMapping("api/message")
public class MessageAction extends SupportAction {

    @Autowired
    private MessageService messageService;

    @GetMapping("/detail")
    @ResponseBody
    public AjaxMsg detail(int id) {
        AjaxMsg ajaxMsg = new AjaxMsg();
        Map<String,Object>  message=messageService.getById(id);
        ajaxMsg.setDatas(message);
        return ajaxMsg;
    }
}
